package com.kantboot.business.gc.controller;

import com.kantboot.business.gc.domain.dto.BusGcCollectSearchUserDTO;
import com.kantboot.business.gc.service.IBusGcUserOpenGameService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/business/gc/userOpenGame")
public class BusGcUserOpenGameController {

    @Resource
    private IBusGcUserOpenGameService service;

    /**
     * 添加游戏列表
     * @param gameId
     * @return
     */
    @RequestMapping("/add")
    public RestResult addCollect(@RequestParam("gameId") Long gameId) {
        log.info("正在执行[添加游戏列表]操作,gameId:{}",gameId);
        return RestResult.success(service.AddUserOpenGameService(gameId),"getSuccess","获取成功");
    }

    /**
     * 获取用户游戏浏览列表
     */
    @RequestMapping("/getBodyData")
    public RestResult<PageResult> getBodyData(@RequestBody PageParam<BusGcCollectSearchUserDTO> param) {
        return RestResult.success(service.getBodyData(param), "getSuccess", "获取成功");
    }
}
